file(GLOB mltdecklink_src *.cpp)
if(WIN32)
    list(APPEND mltdecklink_src win/DeckLinkAPI_i.cpp)
    set(mltdecklink_inc ${CMAKE_CURRENT_SOURCE_DIR}/win)
elseif(APPLE)
    list(APPEND mltdecklink_src darwin/DeckLinkAPIDispatch.cpp)
    set(mltdecklink_inc ${CMAKE_CURRENT_SOURCE_DIR}/darwin)
else()
    list(APPEND mltdecklink_src linux/DeckLinkAPIDispatch.cpp)
    set(mltdecklink_inc ${CMAKE_CURRENT_SOURCE_DIR}/linux)
endif()
add_library(mltdecklink MODULE ${mltdecklink_src})
target_link_libraries(mltdecklink mlt Threads::Threads)
target_include_directories(mltdecklink PRIVATE ${mltdecklink_inc})
# Create module in parent directory, for the benefit of "source setenv".
set_target_properties(mltdecklink PROPERTIES LIBRARY_OUTPUT_DIRECTORY ..)
install(TARGETS mltdecklink LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mlt)
file(GLOB yml *.yml)
install(FILES ${yml} DESTINATION ${CMAKE_INSTALL_DATADIR}/mlt/decklink)
